<script>
    import dayjs from 'dayjs'
    export default {
        name: 'SearchContion',
        data() {
            return {
                meterTypeOptions: [],
            }
        },
        inject: ['tableRoot'],
        created() {
            this.tableRoot.setFieldsValue(
                {
                    date: dayjs().format('YYYY-MM-DD'),
                    time: [
                        dayjs().subtract(30, 'minute').format('HH:mm:ss'),
                        dayjs().format('HH:mm:ss'),
                    ],
                    // subitemId: subitemId && subitemId.length ? subitemId[0].id : '',
                },
                { refresh: true }
            )
        },
    }
</script>

<template>
    <fragment>
        <GridItem :index="0">
            <SearchFormItem label="日期:">
                <el-date-picker
                    v-model="tableRoot.searchParams.date"
                    type="date"
                    placeholder="选择日期"
                    value-format="yyyy-MM-dd"
                    size="small"
                    style="width: 70%"
                >
                </el-date-picker>
            </SearchFormItem>
        </GridItem>
        <GridItem :index="1">
            <SearchFormItem label="时间:">
                <el-time-picker
                    is-range
                    v-model="tableRoot.searchParams.time"
                    range-separator="至"
                    start-placeholder="开始时间"
                    end-placeholder="结束时间"
                    placeholder="选择时间范围"
                    value-format="HH:mm:ss"
                    size="small"
                >
                </el-time-picker>
            </SearchFormItem>
        </GridItem>

        <!-- <GridItem :index="1">
            <SearchFormItem>
                <el-button size="small" @click="addOnClick" type="primary">导出</el-button>
            </SearchFormItem>
        </GridItem> -->
    </fragment>
</template>
<style lang="scss" scoped></style>
